﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Lenovo.CFI.Common.Sys;
using Lenovo.CFI.DAL.Sys;

namespace Lenovo.CFI.BLL.Sys
{
    public class SysParaBl
    {
        private const string IP_OWNER = "IPOwner";              // IP Owner 默认的IP
        private const string REVIEWER_LIST = "ReviewerList";    // Reviewer List 默认的评审专家
        private const string TEMP_CFI = "TemplateCfi";          // 
        private const string TEMP_CS = "TemplateCSuggestion";   // 
        private const string TOPIC_TEAM_LIST = "TopicTeamList";   // 


        /// <summary>
        /// 获取默认的IP
        /// </summary>
        /// <returns></returns>
        public string GetIPOwner()
        {
            return SysParaDa.GetSysPara(IP_OWNER);
        }

        public void SaveIPOwner(string value)
        {
            SysParaDa.SaveSysPara(IP_OWNER, value);
        }

        public string GetTopicReviewers()
        {
            return SysParaDa.GetSysPara(REVIEWER_LIST);
        }

        public void SaveTopicReviewers(string value)
        {
            SysParaDa.SaveSysPara(REVIEWER_LIST, value);
        }


        public Guid? GetTemplateCfi()
        {
            string v = SysParaDa.GetSysPara(TEMP_CFI);
            if (v != null)
                return new Guid(v);
            else
                return null;
        }

        public void SaveTemplateCfi(Guid file)
        {
            SysParaDa.SaveSysPara(TEMP_CFI, file.ToString());
        }

        public Guid? GetTemplateCSuggestion()
        {
            string v = SysParaDa.GetSysPara(TEMP_CS);
            if (v != null)
                return new Guid(v);
            else
                return null;
        }

        public void SaveTemplateCSuggestion(Guid file)
        {
            SysParaDa.SaveSysPara(TEMP_CS, file.ToString());
        }


        public string GetTopicTeamList(int topicID)
        {
            return SysParaDa.GetSysPara(TOPIC_TEAM_LIST + topicID);
        }

        public void SaveTopicTeamList(int topicID, string value)
        {
            SysParaDa.SaveSysPara(TOPIC_TEAM_LIST + topicID, value);
        }

    }
}
